#include <stdio.h>
#include "hw.h"

int main(void)
{
    int i;
    int temp;
    stack *mystack = NULL;   
    stack *queuestack = NULL;

    stack_init(&mystack, sizeof(int));
    stack_init(&queuestack, sizeof(int));

    printf("进入顺序: ");
	for (i = 1; i < 10; i++) {
        stack_push(mystack, &i); 
        printf("%d ", i);
    }
    putchar('\n');

    while (!stack_empty(mystack)) {
        stack_pop(mystack, &temp);
        stack_push(queuestack, &temp);
    }
 
   	while (!stack_empty(queuestack)) {
        stack_pop(queuestack, &i);
        printf("%d ", i);
    }
    putchar('\n');
   
    stack_destroy(mystack);
    stack_destroy(queuestack);

    return 0;
}
